from efdjcommon.utils.settings import import_settings

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)

APP_ENV = os.environ.get('APP_ENV', 'dev')
USE_DEBUG_TOOLBAR = (APP_ENV == 'dev') and os.environ.get('DEBUG_TOOLBAR', False)

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sitemaps',
]

if USE_DEBUG_TOOLBAR:
    INSTALLED_APPS.append('debug_toolbar')

import_settings(
    globals(),
    ['common', APP_ENV],
    INSTALLED_APPS,
    ['INSTALLED_APPS', 'STATICFILES_DIRS'],
    str(__name__)
)
